import java.util.Scanner;

class Book{
    String name;
    int price;
    String author;
    int edition;

    Book(String name, int price, String author, int edition){
        this.name = name;
        this.price = price;
        this.author = author;
        this.edition = edition;
    }

    public boolean equals(Object o){
        if(o==null)return false;
        Book b=(Book)o;
        if(b.name.equalsIgnoreCase(this.name)&&b.author.equalsIgnoreCase(this.author)&&b.edition==this.edition){
            return true;
        }else{
            return false;
        }
    }

    public String toString(){
        return "name: "+name+", price: "+price+", author: "+author+", edition: "+edition;
    }
}
public class Main2 {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        Book b1 = new Book(s.next(),
                s.nextInt(),
                s.next(),
                s.nextInt());
        Book b2 = new Book(s.next(),s.nextInt(),s.next(),s.nextInt());

        System.out.println(b1);
        System.out.println(b2);
        System.out.println(b1.equals(b2));

    }

}

/* 你的代码被嵌在这里 */
